//
//  DKHomeStepView.m
//  DanKU
//
//  Created by 吴斌 on 2023/9/26.
//

#import "DKHomeStepView.h"
@interface DKHomeStepView()
@property (nonatomic, strong)UIImageView * dk_homeImgView;
@property (nonatomic, strong)UILabel * dk_homeTitleView;

@end
@implementation DKHomeStepView
-(instancetype)init{
    if(self == [super init]){
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    self.dk_homeImgView = [[UIImageView alloc] init];
    self.dk_homeImgView.userInteractionEnabled = YES;
    [self addSubview:self.dk_homeImgView];
    [self.dk_homeImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.height.equalTo(@(DK_IsWidthScale(44)));
        make.width.equalTo(@(DK_IsWidthScale(44)));
        make.centerX.equalTo(self);
    }];
    self.dk_homeTitleView = [[UILabel alloc] init];
    self.dk_homeTitleView.textColor = DK_Hex(@"#FFFFFF");
    self.dk_homeTitleView.font = DK_FONT_Regular(15);
    self.dk_homeTitleView.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.dk_homeTitleView];
    [self.dk_homeTitleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(0)));
        make.right.equalTo(@(DK_IsWidthScale(0)));
        make.top.equalTo(self.dk_homeImgView.mas_bottom).offset(DK_IsWidthScale(10));
        make.bottom.equalTo(@(DK_IsWidthScale(0)));
    }];
}
-(void)setImageName:(NSString *)imageName{
    _imageName = imageName;
    self.dk_homeImgView.image = DK_GetImage(_imageName);
}
-(void)setStepName:(NSString *)stepName{
    _stepName = stepName;
    self.dk_homeTitleView.text = _stepName;
}
@end
